import service from "@/services/fluoriteCloud";
import Qs from "qs";
//获取token
export function getVideoToken(parameter) {
  let { appKey, appSecret } = parameter;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `https://open.ys7.com/api/lapp/token/get?appKey=${appKey}&appSecret=${appSecret}`,
    method: "POST",
  });
}

//开始云台控制【开始云台控制之后必须先调用停止云台控制接口才能进行其他操作，包括其他方向的云台转动】
export function startVideoControl(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `https://open.ys7.com/api/lapp/device/ptz/start?${Qs.stringify(
      parameter
    )}`,
    method: "POST",
  });
}

//停止云台控制
export function stopVideoControl(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `https://open.ys7.com/api/lapp/device/ptz/stop?${Qs.stringify(
      parameter
    )}`,
    method: "POST",
  });
}

//添加预置点
export function addPreset(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `https://open.ys7.com/api/lapp/device/preset/add?${Qs.stringify(
      parameter
    )}`,
    method: "POST",
  });
}

//调用预置点
export function movePreset(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `https://open.ys7.com/api/lapp/device/preset/move?${Qs.stringify(
      parameter
    )}`,
    method: "POST",
  });
}

//清除预置点
export function clearPreset(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `https://open.ys7.com/api/lapp/device/preset/clear?${Qs.stringify(
      parameter
    )}`,
    method: "POST",
  });
}
